package com.wondersgroup.core.service;

import java.util.ArrayList;
import java.util.List;

import org.springframework.stereotype.Service;

import com.wondersgroup.core.resultmap.DTOSearchCompanyRode;

@Service
public class SearchCompanyRodeService {
	 
	public List<DTOSearchCompanyRode> searchCompanyRode(String companyId,String barcode,String batchNo){
         //假数据，根据条形码批次号查询追溯信息
		   List<DTOSearchCompanyRode> list=new ArrayList<DTOSearchCompanyRode>();
		   
		      DTOSearchCompanyRode dtoSearchCompanyRode1=new DTOSearchCompanyRode();
		      DTOSearchCompanyRode dtoSearchCompanyRode2=new DTOSearchCompanyRode();
		      DTOSearchCompanyRode dtoSearchCompanyRode3=new DTOSearchCompanyRode();
		      
			if(barcode.equals("6948195800309")){
				if(batchNo.equals("20150728")){

			           dtoSearchCompanyRode1.setCompany_name("农工商超市（集团）有限公司第二八五分店");
			           dtoSearchCompanyRode1.setCompany_biz_address("上海市虹口区水电路306号底层");

			           dtoSearchCompanyRode1.setProductDate("2015-08-25"+"进货");

			           list.add(dtoSearchCompanyRode1);
			           
			           dtoSearchCompanyRode2.setCompany_name("上海南浦大桥食品批发交易市场");
			           dtoSearchCompanyRode2.setCompany_biz_address("上海市黄浦区外马路１２１８号");
			           dtoSearchCompanyRode2.setProductDate("2015-08-03"+"进货");
			           list.add(dtoSearchCompanyRode2);
			           
			           dtoSearchCompanyRode3.setCompany_name("上海嘉里食品工业有限公司");
			           dtoSearchCompanyRode3.setCompany_biz_address("上海市浦东新区高东路118号B区");
			           dtoSearchCompanyRode3.setProductDate("2015-07-28"+"生产");
			           list.add(dtoSearchCompanyRode3);
	 
				}

			}if(barcode.equals("6901209302220")){
				if(batchNo.equals("20150716044703")){
			           dtoSearchCompanyRode1.setCompany_name("上海联家超市有限公司共江店");
			           dtoSearchCompanyRode1.setCompany_biz_address("上海市宝山区共江路1208号");

			           dtoSearchCompanyRode1.setProductDate("2015-07-25"+"进货");

			           list.add(dtoSearchCompanyRode1);
			           
			           dtoSearchCompanyRode2.setCompany_name("上海南浦大桥食品批发交易市场");
			           dtoSearchCompanyRode2.setCompany_biz_address("上海市黄浦区外马路１２１８号");

			           dtoSearchCompanyRode2.setProductDate("2015-07-20"+"生产");

			           
			           list.add(dtoSearchCompanyRode2);
			           
			          
	 
				}
		 
			}if(barcode.equals("6925303710156")){
				if(batchNo.equals("20150815ks33")){

			           dtoSearchCompanyRode1.setCompany_name("上海联家超市有限公司共江店");
			           dtoSearchCompanyRode1.setCompany_biz_address("上海市宝山区共江路1208号");
			           dtoSearchCompanyRode1.setProductDate("2015-09-01"+"进货" );
			           list.add(dtoSearchCompanyRode1);
			           
			           dtoSearchCompanyRode2.setCompany_name("上海南浦大桥食品批发交易市场");
			           dtoSearchCompanyRode2.setCompany_biz_address("上海市黄浦区外马路１２１８号");
			           dtoSearchCompanyRode2.setProductDate("2015-08-15"+"生产" );
			           list.add(dtoSearchCompanyRode2);
			           
			          
	 
				}
			}

		return list;
	}
}
